/*     */ package com.engine;
/*     */ 
/*     */ import java.text.DecimalFormat;
/*     */ 
/*     */ public class ConvertNumberToText
/*     */ {
/*     */   String ANGKA;
/*     */   String SATUAN;
/*     */   String PULUHAN;
/*     */   String RATUSAN;
/*     */   int angka;
/*     */   int satuan;
/*     */   int puluhan;
/*     */   int Puluhan;
/*     */   int ratusan;
/*     */   DecimalFormat dec;
/*     */ 
/*     */   public ConvertNumberToText(String format)
/*     */   {
/*  19 */     this.dec = new DecimalFormat(format);
/*     */   }
/*     */ 
/*     */   public String convert1(int angka)
/*     */   {
/*  24 */     String ret = "";
/*  25 */     String strAngka = this.dec.format(angka);
/*  26 */     for (int i = 0; i < strAngka.length(); i++)
/*     */     {
/*  28 */       String item = strAngka.substring(i, i + 1);
/*  29 */       int angka1 = Integer.parseInt(item);
/*  30 */       switch (angka1) {
/*     */       case 0:
/*  32 */         ret = ret + "nol "; break;
/*     */       case 1:
/*  33 */         ret = ret + "satu "; break;
/*     */       case 2:
/*  34 */         ret = ret + "dua "; break;
/*     */       case 3:
/*  35 */         ret = ret + "tiga "; break;
/*     */       case 4:
/*  36 */         ret = ret + "empat "; break;
/*     */       case 5:
/*  37 */         ret = ret + "lima "; break;
/*     */       case 6:
/*  38 */         ret = ret + "enam "; break;
/*     */       case 7:
/*  39 */         ret = ret + "tujuh "; break;
/*     */       case 8:
/*  40 */         ret = ret + "delapan "; break;
/*     */       case 9:
/*  41 */         ret = ret + "sembilan ";
/*     */       }
/*     */     }
/*  44 */     return ret;
/*     */   }
/*     */ 
/*     */   public String convert(int angka) {
/*  48 */     String ret = "";
/*     */ 
/*  50 */     this.ratusan = (angka / 100);
/*  51 */     this.Puluhan = (angka % 100);
/*  52 */     this.puluhan = (this.Puluhan / 10);
/*  53 */     this.satuan = (angka % 10);
/*  54 */     if ((angka < 1000) && (angka > 0)) {
/*  55 */       switch (this.ratusan) { case 0:
/*  56 */         break;
/*     */       case 1:
/*  57 */         ret = "satu "; break;
/*     */       case 2:
/*  58 */         ret = "dua "; break;
/*     */       case 3:
/*  59 */         ret = "tiga "; break;
/*     */       case 4:
/*  60 */         ret = "empat "; break;
/*     */       case 5:
/*  61 */         ret = "lima "; break;
/*     */       case 6:
/*  62 */         ret = "enam "; break;
/*     */       case 7:
/*  63 */         ret = "tujuh "; break;
/*     */       case 8:
/*  64 */         ret = "delapan "; break;
/*     */       case 9:
/*  65 */         ret = "sembilan ";
/*     */       }
/*     */ 
/*  73 */       if (angka >= 20) {
/*  74 */         switch (this.puluhan) { case 0:
/*  75 */           ret = ret + "nol "; break;
/*     */         case 1:
/*  76 */           ret = ret + "satu "; break;
/*     */         case 2:
/*  77 */           ret = ret + "dua "; break;
/*     */         case 3:
/*  78 */           ret = ret + "tiga "; break;
/*     */         case 4:
/*  79 */           ret = ret + "empat "; break;
/*     */         case 5:
/*  80 */           ret = ret + "lima "; break;
/*     */         case 6:
/*  81 */           ret = ret + "enam "; break;
/*     */         case 7:
/*  82 */           ret = ret + "tujuh "; break;
/*     */         case 8:
/*  83 */           ret = ret + "delapan "; break;
/*     */         case 9:
/*  84 */           ret = ret + "sembilan ";
/*     */         }
/*     */ 
/*     */       }
/*     */ 
/*  97 */       if (this.Puluhan == 11);
/*     */     }
/*     */     else
/*     */     {
/* 101 */       switch (this.satuan) { case 0:
/* 102 */         ret = ret + "nol "; break;
/*     */       case 1:
/* 103 */         ret = ret + "satu "; break;
/*     */       case 2:
/* 104 */         ret = ret + "dua "; break;
/*     */       case 3:
/* 105 */         ret = ret + "tiga "; break;
/*     */       case 4:
/* 106 */         ret = ret + "empat "; break;
/*     */       case 5:
/* 107 */         ret = ret + "lima "; break;
/*     */       case 6:
/* 108 */         ret = ret + "enam "; break;
/*     */       case 7:
/* 109 */         ret = ret + "tujuh "; break;
/*     */       case 8:
/* 110 */         ret = ret + "delapan "; break;
/*     */       case 9:
/* 111 */         ret = ret + "sembilan ";
/*     */       default:
/* 112 */         break;
/*     */ 
/* 119 */         angka = -1; }
/*     */     }
/* 121 */     return ret.trim();
/*     */   }
/*     */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.engine.ConvertNumberToText
 * JD-Core Version:    0.6.0
 */